package com.hqully.smartfumehood.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hqully.smartfumehood.common.vo.QueryVo;
import com.hqully.smartfumehood.entity.SmokeData;
import com.hqully.smartfumehood.service.SmokeDataService;
import com.hqully.smartfumehood.mapper.SmokeDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author ZH.ming
* @description 针对表【smoke_data】的数据库操作Service实现
* @createDate 2022-06-24 10:30:48
*/
@Service
public class SmokeDataServiceImpl extends ServiceImpl<SmokeDataMapper, SmokeData>
    implements SmokeDataService{

    @Autowired
    private SmokeDataMapper  smokeDataMapper;
    @Override
    public int addSmokeDataGroup(List<SmokeData> smokeDataList) {
        return smokeDataMapper.addSmokeDataGroup(smokeDataList);
    }

    @Override
    public PageInfo<SmokeData> findAllSmokeDataByAirId(QueryVo queryVo) {
        PageHelper.startPage(queryVo.getPageNum(),queryVo.getPageSize(),true);

        List<SmokeData> smokeDataList = smokeDataMapper.findAllByAirId(queryVo.getQuery());

        PageInfo<SmokeData> smokeDataPageInfo = new PageInfo<>(smokeDataList);
        return smokeDataPageInfo;
    }
}




